From efdc101754611d3981761d033ce6422da09fd1f4 Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Tue, 31 Mar 2026 15:15:30 +0800 Subject: [PATCH] ci: Add Rust validate targets to Justfile for local development Add just targets mirroring the CI Rust checks so developers can run them locally before pushing: - validate: runs both fmt and clippy checks - cargo-fmt-check: checks formatting across all crates - cargo-clippy: runs clippy with the same lint config as CI Co-Authored-By: Claude Opus 4.6 Signed-off-by: Xiaofeng Wang --- Justfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Justfile b/Justfile index 8f96a7dc..64840429 100644 --- a/Justfile +++ b/Justfile @@ -133,3 +133,20 @@ clang-format: # Check source files against clang-format defaults clang-format-check: {{sourcefiles}} | xargs clang-format -i --Werror --dry-run + +clippy_config := "-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code" + +# Run all Rust lint and format checks (mirrors CI) +validate: + just cargo-fmt-check + just cargo-clippy + +# Check Rust formatting across all crates +cargo-fmt-check: + cargo fmt -p ostree -- --check -l + for d in tests/inst tests/bootc-integration tests/xtask; do cargo fmt --manifest-path $d/Cargo.toml -- --check -l; done + +# Run cargo clippy across all crates +cargo-clippy: + cargo clippy -p ostree --features=v2022_6 -- {{clippy_config}} + for d in tests/inst tests/bootc-integration tests/xtask; do cargo clippy --manifest-path $d/Cargo.toml -- {{clippy_config}}; done -- 2.39.5